-
Notifications
You must be signed in to change notification settings - Fork 0
chore(mbe): add api-ts desc's for wallet creation and signings #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(mbe): add api-ts desc's for wallet creation and signings #93
Conversation
510ea69 to
88e7e29
Compare
88e7e29 to
017943a
Compare
Also adds walletVersion to the list of params. Ticket: WP-5335
1664afa to
d0b154f
Compare
d0b154f to
ef8e38d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the Master BitGo Express API specification by extracting route definitions into separate files and moving types to dedicated route modules. The changes improve code organization and maintain functionality while adding comprehensive API documentation.
- Extracts individual route definitions from a large monolithic file into dedicated route files
- Moves type definitions from the main API spec to their respective route modules
- Adds comprehensive JSDoc documentation for all API endpoints and request/response types
Reviewed Changes
Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/api/master/routers/masterBitGoExpressApiSpec.ts | Refactored to import route definitions from separate files, removing hundreds of lines of inline definitions |
| src/api/master/routers/signAndSendMpcRoute.ts | New file containing MPC transaction signing route definition with documentation |
| src/api/master/routers/sendManyRoute.ts | New file containing send many transactions route with comprehensive parameter documentation |
| src/api/master/routers/recoveryRoute.ts | New file containing wallet recovery route with detailed recovery options for different coin types |
| src/api/master/routers/recoveryConsolidationsRoute.ts | New file containing recovery consolidations route for multi-address wallet recovery |
| src/api/master/routers/generateWalletRoute.ts | New file containing wallet generation route with detailed wallet and keychain type definitions |
| src/api/master/routers/consolidateUnspentsRoute.ts | New file containing UTXO consolidation route for unspent transaction outputs |
| src/api/master/routers/consolidateRoute.ts | New file containing address consolidation route for account-based assets |
| src/api/master/routers/accelerateRoute.ts | New file containing transaction acceleration route supporting CPFP and RBF methods |
| src/api/master/handlers/recoveryWallet.ts | Updated import path for moved recovery types |
| src/api/master/handlers/generateWallet.ts | Added request spreading to wallet parameters |
| src/tests/api/master/generateWallet.test.ts | Updated test expectations to match new response type structure |
| src/tests/api/master/eddsa.test.ts | Removed outdated TODO comment |
| masterBitgoExpress.json | Updated OpenAPI specification with enhanced documentation and error response codes |
| /** | ||
| * Common keychain of the wallet during wallet creation | ||
| */ | ||
| commonKeychain: t.string, |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commonKeychain field is defined as required in the object but optional in the response schema. According to the OpenAPI spec (line 884), this field is required, but the type definition allows it to be undefined. This inconsistency could cause validation issues.
| /** | ||
| * Required for transactions from MPC wallets. | ||
| */ | ||
| type: t.union([ |
Copilot
AI
Aug 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type field includes values like 'fillNonce', 'acceleration', 'accountSet', 'enabletoken', 'transfertoken', and 'trustline' but the OpenAPI specification shows a different set of values that excludes 'stakingLock' and 'stakingUnlock'. This mismatch between the code and the generated specification could lead to client-side validation errors.
Ticket: WP-5355